package org.iabako.client.ui.page.business.installment;

import org.iabako.client.navigation.NavigationController;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.client.ui.form.AbstractForm;
import org.iabako.client.ui.form.business.payment.OnePaymentForm;
import org.iabako.shared.entity.business.AbstractEntity;
import org.iabako.shared.entity.business.Installment;

/**
 * Created by jose on 10/09/14.
 */
public class InstallmentModify extends OnePaymentForm {

    public InstallmentModify(AbstractForm parentForm) {
        super(false, true);

        this.parentForm = parentForm;

        final String[] params = NavigationController.getInstance().getParams();

        installmentServiceAsync.getById(Long.parseLong(params[0]), new IabakoAsyncCallback<AbstractEntity>() {
            public void onSuccess(AbstractEntity result) {
                setInstallment((Installment) result);
                super.onSuccess(result);
            }
        });
    }
}
